<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<style>
	.barPannel{border: none;padding:10px 10px 10px 120px;height: 80px;line-height: 20px;word-wrap : break-word ;} 
	.barPannel .img{width:100px;margin-left:-110px;height: 80px;position: absolute;overflow: hidden;background-color: #CECECE;}
	.barPannel .img img{
		 max-height:80px; 
		 max-width:100px; 
		 width:expression(this.width > 100 && this.height < this.width ? 100: true); 
		 height:expression(this.height > 80 ? 80: true);
	}
	.barPannel .title{height: 65px;font-size: 16px;}
	.barPannel .sub{color:#9D9D9D;}
</style>
<div class="_pannel " id="newsList">

</div>
<script type="text/javascript">
	var ajaxNewsListStartID=0;
	$(function(){
		ajaxNewsList(ajaxNewsListStartID);
		function ajaxNewsList(index){
			ajaxNewsListStartID=index+20;
			var $list=$("#newsList");
			sendRequest("${ctx}/news/ajaxNewsList.html",{begin:index},function(data){
				$.each(data,function(i){ 
					$list.append('<div class="_rowP _MT10 barPannel"  onclick="showPM(\'${ctx}/news/show/'+data[i].id+'.html\')">'
							+'<div class="img"><img alt="" src="'+data[i].img+'"></div>'
							+'<div class="title">'+data[i].title+'</div>'
							+'<div class="sub">'+data[i].type+'   '+data[i].id+' 阅读</div>'
							+'</div>')
				});
			});
		};
		$("#newsList").parents(".swiper-slide").scroll(function () {
			var divH=$(this).height();
			var sH=$(this)[0].scrollHeight;
			var sT=$(this)[0].scrollTop;
	        if (divH+sT>=sH) {
	        	ajaxNewsList(ajaxNewsListStartID);
	        }
	   });
	});
	
</script>
